<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<c:set var="ctx" value="<%=request.getContextPath()%>" />

	<div id="sidebar" class="sidebar  responsive">
		<script type="text/javascript">
			try{ace.settings.check('sidebar' , 'fixed')}catch(e){}
		</script>

		<div class="sidebar-shortcuts" id="sidebar-shortcuts">
			<div class="sidebar-shortcuts-large" id="sidebar-shortcuts-large">

				<!-- /section:basics/sidebar.layout.shortcuts -->
			</div>

			<div class="sidebar-shortcuts-mini" id="sidebar-shortcuts-mini">
				<span class="btn btn-success"></span>

				<span class="btn btn-info"></span>

				<span class="btn btn-warning"></span>

				<span class="btn btn-danger"></span>
			</div>
		</div><!-- /.sidebar-shortcuts -->

		<ul class="nav nav-list">
			<c:forEach items="${user.menus}" var="item" varStatus="i">
			<c:choose>
				<c:when test="${pname!=null&&pname==item.name}">
					<li class="active open">
				</c:when>
				<c:otherwise>
					<li>
				</c:otherwise>
			</c:choose>
				<a  href="javascript:void(0);" class="dropdown-toggle">
					<i class="menu-icon ${item.iconTxt}"></i>
					<span class="menu-text">${item.name}</span>

					<b class="arrow fa fa-angle-down"></b>
				</a>

				<b class="arrow"></b>

				<ul class="submenu">
					<c:forEach items="${item.menus}" var="m" varStatus="index">
					<c:choose>
						<c:when test="${mname!=null&&mname==m.name}">
							<li class="active ">
						</c:when>
						<c:otherwise>
							<li>
						</c:otherwise>
					</c:choose>
						<a href="javascript:void(0);" data-url="${m.url}">
							<i class="menu-icon fa fa-caret-right"></i>
							${m.name}
						</a>

						<b class="arrow"></b>
					</li>
					</c:forEach>
				</ul>
			</li>
			</c:forEach>
		</ul><!-- /.nav-list -->

		<!-- #section:basics/sidebar.layout.minimize -->
		<div class="sidebar-toggle sidebar-collapse" id="sidebar-collapse">
			<i class="ace-icon fa fa-angle-double-left" data-icon1="ace-icon fa fa-angle-double-left" data-icon2="ace-icon fa fa-angle-double-right"></i>
		</div>

		<!-- /section:basics/sidebar.layout.minimize -->
		<script type="text/javascript">
			try{ace.settings.check('sidebar' , 'collapsed')}catch(e){}
			$(function(){

				$(document.body).on('click','.submenu li a',function(){						
					location.href=$(this).attr('data-url');
				});
			});
			
		</script>
	</div>
